<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="renderer" content="webkit">
    <title>${setting.siteName} - 编辑物流表</title>
    <meta name="keywords" content="${setting.siteName}">
    <meta name="description" content="${setting.siteName}">
    <!-- BEGIN HEADER -->
    [#include "/admin/include/style.ftl"]
    <!-- END HEADER -->
</head>
<body class="gray-bg">
<div class="wrapper wrapper-content  animated fadeInRight">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>编辑物流表</h5>
                    <div class="ibox-tools">
                        <button type="button" class="btn btn-outline btn-white btn-xs" id="btn-return-loippi"
                                onclick="location.href='${base}/admin/tlogistics/list.jhtml'"><i
                                    class="fa fa-reply-all"></i> 返回列表
                        </button>
                    </div>
                </div>
                <div class="ibox-content">
                    <form id="inputForm" class="form-horizontal" action="${base}/admin/tlogistics/update.jhtml"
                          method="post">
                        <input type="hidden" value="${tLogistics.id}" name="id"/>
                        <div class="form-group">
                            <div class="row">
                                <div class="col-sm-6">
                                    <label class="col-sm-3 control-label">选择订单</label>
                                    <div class="col-sm-9">
                                        <select name="orderId" class="form-control">
                                            [#list orders as o]
                                                <option value="${o.id}"
                                                        [#if o.id == tLogistics.orderId]selected[/#if]>${o.userName}
                                                    -${o.phone}</option>
                                            [/#list]
                                        </select>
                                    </div>
                                </div>
                                <div class="col-sm-6">
                                    <label class="col-sm-3 control-label">物流信息</label>
                                    <div class="col-sm-9">
                                        <input type="text" name="content" class="form-control"
                                               value="${(tLogistics.content)!''}" maxlength=" 200"/>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <!--/row-->
                        <div class="form-group">
                            <div class="row">
                                <div class="col-sm-6">
                                    <label class="col-sm-3 control-label">物流编号</label>
                                    <div class="col-sm-9">
                                        <input type="text" name="logisticsNum" class="form-control"
                                               value="${(tLogistics.logisticsNum)!''}" maxlength=" 200"/>
                                    </div>
                                </div>
                                <div class="col-sm-6">
                                    <label class="col-sm-3 control-label">物流状态</label>
                                    <div class="col-sm-9">
                                        <select class="form-control" name="logisticsState">
                                            <option value="2" [#if 2 == tLogistics.orderId]selected[/#if]>待发货
                                            </option>
                                            <option value="3" [#if 3 == tLogistics.orderId]selected[/#if]>已发货
                                            </option>
                                            <option value="4" [#if 4 == tLogistics.orderId]selected[/#if]>已送达
                                            </option>
                                            <option value="5" [#if 5 == tLogistics.orderId]selected[/#if]>已签收
                                            </option>
                                            <option value="-1" [#if -1 == tLogistics.orderId]selected[/#if]>已取消
                                            </option>
                                        </select>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="row">
                                <div class="col-sm-6">
                                    <label class="col-sm-3 control-label">运费</label>
                                    <div class="col-sm-9">
                                        <input type="number" name="fee" class="form-control"
                                               onkeyup="this.value=this.value.replace(/\D|^0/g,'')" value="${(tLogistics.fee)!''}" maxlength=" 200"/>
                                    </div>
                                </div>
                                <div class="col-sm-6">
                                    <label class="col-sm-3 control-label">物流名称</label>
                                    <div class="col-sm-9">
                                        <input type="text" name="logisticsName" class="form-control"
                                               value="${(tLogistics.logisticsName)!''}" maxlength=" 200"/>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <!--/row-->
                        <div class="hr-line-dashed"></div>
                        <div class="form-group">
                            <div class="col-sm-12 col-sm-offset-10">
                                <button type="button" class="btn btn-default" onclick="window.history.back();">返回
                                </button>
                                <button class="btn btn-success" type="submit">保存内容</button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
<!-- BEGIN Script -->
[#include "/admin/include/script.ftl"]
<!-- END Script -->
<script>
    $(document).ready(function () {
        [@flash_message /]
        $(".chosen-select").chosen({width: "100%"});
        $(".input-daterange").datepicker({keyboardNavigation: false, forceParse: false, autoclose: true});

        $(".browserButton").browser({
            callback: function (url) {
                $("#" + $(this).attr('for')).val(url);
            }
        });

        $(".input-group.date").datepicker({
            todayBtn: "linked",
            keyboardNavigation: false,
            forceParse: false,
            calendarWeeks: true,
            autoclose: true
        });
        $("#inputForm").validate({
            rules: {
                orderId: {
                    required: true
                }
                , content: {
                    required: true
                }
                , logisticsState: {
                    required: true
                }
                , logisticsName: {
                    required: true
                }
                , fee: {
                    required: true,
                    min: 0
                }
                , logisticsNum: {
                    required: true
                }
            },
            messages: {}
        });
    });
</script>
</body>
</html>
